<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style lang="css">
        .grid-container {
            display: grid;
            /*? grid-template-columns 用于定义每一列的宽度； grid-template-rows 用于定义每一行的高度*/
            grid-template-columns: repeat(3, 1fr);
            grid-template-rows: repeat(3, 1fr);
            gap: 10px;
        }

        .grid-item {
            background-color: #3498db;
            color: #fff;
            font-size: 24px;
            text-align: center;
            padding: 20px;
        }
    </style>
</head>
<body>
<div class="grid-container">
    <div class="grid-item">1</div>
    <div class="grid-item">2</div>
    <div class="grid-item">3</div>
    <div class="grid-item">4</div>
    <div class="grid-item">5</div>
    <div class="grid-item">6</div>
    <div class="grid-item">7</div>
    <div class="grid-item">8</div>
    <div class="grid-item">9</div>
</div>
</body>
</html>
